<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>4.遍历Set类型的方式</title>
</head>

<body>
  <script>
    let set = new Set(['hdcms', 'houdunren']);
    console.log(set.entries()); //SetIterator {'hdcms' => 'hdcms', 'houdunren' => 'houdunren'}
    set.forEach(function (value, key, arr) {
      // set 没有key ， value和key是一个东西
      console.log(key, value); //hdcms hdcms ,houdunren houdunren
      console.log(set);//Set(2) {'hdcms', 'houdunren'}
    })

    // for of 遍历 value
    for (const value of set) {
      console.log(value);
    }
  </script>
</body>

</html>